/**
 * author: WheelChen
 * date: 2017/7/6
 */
public class Solution {
    public int[] twoSum(int[] nums, int target) {
        int[] answer = new int[2];
        for ( int i = 0; i < nums.length; i++ ){
            for (int j = 0; j < nums.length; j++)
                if ( i != j)
                    if (nums[i] + nums[j] == target){
                        if ( i > j){
                            answer[0] = j ;
                            answer[1] = i ;
                        }
                        else{
                            answer[0] = i ;
                            answer[1] = j ;
                        }

                    }
        }
        return answer;
    }
}